#ifndef PLAYBARVIEW_H
#define PLAYBARVIEW_H

#include <QWidget>
#include <QMediaPlayer>
//#include "playEngine/ezvoiceplayer.h"
//#include "playEngine/ezvoiceplayermanager.h"
#include "playEngine/EZVoicePlayerDefin.h"
#include "playEngine/player/ezqaudioplayer.h"


class EZVoicePlayer;
class EZVoicePlayerManager;
class NowPlayListView;

namespace Ui {
class PlayBarView;
}

class PlayBarView : public QWidget
{
    Q_OBJECT

public:
    explicit PlayBarView(QWidget *parent = 0);
    ~PlayBarView();

private:
    Ui::PlayBarView *ui;

    NowPlayListView *_playListView;

    QPoint _upPoint;
public Q_SLOTS:
    void playEvent();
    void playNextEvent();
    void playPreviousEvent();

    void playTestError(QMediaPlayer::Error error);
private Q_SLOTS:
    friend class EZVoicePlayer;
    void stateChanged(EZVoiceState state);
    friend class EZQAudioPlayer;
    void onAudioStatusChange(EZQAudioPlayStatus);

    friend class EZVoicePlayerManager;
    void onPlayIndexChange(int);
    void onPlayQueueTypeChange();
    void onPlayContentChange();

    // self event
    void onTimeOut();
    void onSliderValueChange();
    void onPlayQueueTypeBtClick();
    void onShowPlayListClick();

    virtual void	mousePressEvent(QMouseEvent * event);
    virtual void	mouseReleaseEvent(QMouseEvent * event);
    virtual void	mouseMoveEvent(QMouseEvent * event);
protected:
    virtual void	resizeEvent(QResizeEvent * event);
};

#endif // PLAYBARVIEW_H
